/*******************************************************************************
 * Copyright (c) 2005 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.reliablesource.pleiades;

import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
import org.eclipse.ui.IViewLayout;

public class BrowserPerspectiveFactory implements IPerspectiveFactory {

	/**
	 * Constructs a new <code>BrowserPerspectiveFactory</code>.
	 */
	public BrowserPerspectiveFactory() {
		// do nothing
	}

	/**
	 * Creates the initial layout of the Browser perspective.
	 */
	public void createInitialLayout(IPageLayout layout) {
		layout.addView(IBrowserConstants.BROWSER_VIEW_ID, IPageLayout.RIGHT,
				.25f, IPageLayout.ID_EDITOR_AREA);

		layout.addView(IBrowserConstants.HISTORY_VIEW_ID, IPageLayout.LEFT,
				.3f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$

		layout.addView(SelectedViewPart.ID, IPageLayout.BOTTOM, .3f,
				IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$

		layout.addView(CommentView.ID, IPageLayout.BOTTOM, .3f,
				IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$
		layout.addView("org.eclipse.ui.views.PropertySheet",
				IPageLayout.BOTTOM, .3f, IPageLayout.ID_EDITOR_AREA);

		IViewLayout historyLayout = layout
				.getViewLayout(IBrowserConstants.HISTORY_VIEW_ID);
		IViewLayout selectedTextLayout = layout
				.getViewLayout(SelectedViewPart.ID);
		historyLayout.setCloseable(true);
		layout.setEditorAreaVisible(true);
	}
}
